<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <link rel="icon" href="${pageContext.request.contextPath}/assets/images/favicon.png" type="image/png">
    <link href="${pageContext.request.contextPath}/assets/css/bootstrap.min.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/assets/css/style.css" rel="stylesheet">
    <link href="${pageContext.request.contextPath}/assets/plugins/jquery-ui/jquery-ui.min.css" rel="stylesheet"/>
    <script src="${pageContext.request.contextPath}/assets/js/jquery.min.js"></script>
</head>
<body class="sticky-header">
<jsp:include page="../inc/left.jsp"/>
<div class="main-content" style="background-color: rgb(238, 238, 238); min-height: 870px;">
    <jsp:include page="../inc/header.jsp"/>
    <div class="white-box">
        <div class="page-title-box" style="background-color: #FFFFFF;">
            <h4 class="page-title">品牌列表</h4>
            <ol class="breadcrumb">
                <li>
                    <a href="${pageContext.request.contextPath}/index">首页</a>
                </li>
                <li>
                    <a href="productBrand">品牌</a>
                </li>
                <li class="active">
                    ${empty brand?'品牌添加':'品牌编辑'}
                </li>
            </ol>
            <div class="clearfix"></div>
        </div>
        <form action="${pageContext.request.contextPath}${empty brand? '/goods/addBrand':'/goods/updBrand'}"
              method="post"
              enctype="multipart/form-data" class="page-container">
            <div class="form-group" hidden>
                <input type="number" class="form-control" style="width:400px" value="${empty brand?0:brand.id}"
                       name="id">
            </div>
            <div class="form-group" style="margin-top:20px;margin-left:20px;">
                <label class="form-label col-xs-4 col-sm-2">
                    <%--                    col-md-2 control-label  form-control --%>
                    品牌名称<span style="color:red">*</span>
                </label>
                <div class="formControls col-xs-8 col-sm-9">
                    <input type="text" class="form-control" style="width:400px" value="${empty brand? null:brand.name}"
                           placeholder="请输入品牌名" name="name">
                    <p style="color:gray"></p>
                </div>
            </div>
            <div class="form-group" style="margin-top:20px;margin-left:20px;">
                <label class="form-label col-xs-4 col-sm-2">
                    品牌首字母<span style="color:red">*</span>
                </label>
                <div class="formControls col-xs-8 col-sm-9">
                    <input type="text" class="form-control" style="width:400px" value="${brand.firstLetter}"
                           placeholder="请输入大写品牌首字母" name="firstLetter"></input>
                    <p style="color:gray"></p>
                </div>
            </div>
            <div class="form-group" style="margin-top:20px;margin-left:20px;">
                <label class="form-label col-xs-4 col-sm-2">
                    品牌logo图片<span style="color:red">*</span>
                </label>
                <div class="formControls col-xs-8 col-sm-9">
                    <input type="file" class="imgUpload" accept="image/jpg,image/png,image/jpeg"
                           tip="" red-tip="" upload-num="1" init-val="" upload-type="4"
                           name="file1"/>
                    <p style="color:gray"></p>
                </div>
            </div>
            <div class="form-group" style="margin-top:20px;margin-left:20px;">
                <label class="form-label col-xs-4 col-sm-2">
                    品牌大图<span style="color:lightblue">(非必选)</span>
                </label>
                <div class="formControls col-xs-8 col-sm-9">
                    <input type="file" class="imgUpload" accept="image/jpg,image/png,image/jpeg"
                           upload-num="1" init-val="" upload-type="4" value="${empty brand? null:brand.bigPic}"
                           name="file2"/>
                    <p style="color:gray"></p>
                </div>
            </div>

            <div class="form-group" style="margin-top:20px;margin-left:20px;">
                <label class="form-label col-xs-4 col-sm-2">
                    品牌排序<span style="color:lightblue"></span>
                </label>
                <div class="formControls col-xs-8 col-sm-9">
                    <input type="number" class="form-control" style="width:400px" value="${empty brand? 0:brand.sort}"
                           placeholder="请输入品牌排序权重" name="sort">
                    <p style="color:gray"></p>
                </div>
            </div>
            <div class="form-group" style="margin-top:20px;margin-left:20px;">
                <label class="form-label col-xs-4 col-sm-2">
                    商品数量<span style="color:lightblue"></span>
                </label>
                <div class="formControls col-xs-8 col-sm-9">
                    <input type="number" class="form-control" style="width:400px"
                           value="${empty brand? 0:brand.productCount}"
                           placeholder="请输入商品数量" name="productCount">
                    <p style="color:gray"></p>
                </div>
            </div>
            <div class="form-group" style="margin-top:20px;margin-left:20px;">
                <label class="form-label col-xs-4 col-sm-2">
                    评论数量<span style="color:lightblue"></span>
                </label>
                <div class="formControls col-xs-8 col-sm-9">
                    <input type="number" class="form-control" style="width:400px"
                           value="${empty brand? 0:brand.productCommentCount}"
                           placeholder="请输入评论数量" name="productCommentCount">
                    <p style="color:gray"></p>
                </div>
            </div>

            <div class="form-group" style="margin-top:20px;margin-left:20px;">
                <label class="col-xs-4 col-sm-2">
                    品牌制造商<br>
                    是否显示
                </label>
                <div class="radio-danger col-xs-5 col-sm-6">
                    <input id="r1" type="radio" checked value="0"
                           name="factoryStatus"><label for="r1">不显示</label>&nbsp;
                    <input id="r2" type="radio" value="1"
                           name="factoryStatus"><label for="r2">显示</label>
                    <p style="color:gray"></p>
                </div>
            </div>
            <div class="form-group" style="margin-top:20px;margin-left:20px;">
                <label class="col-xs-4 col-sm-2">
                    品牌状态<br>
                    是否显示
                </label>
                <div class="radio-danger col-xs-5 col-sm-6">
                    <input id="s1" type="radio" checked value="0"
                           name="showStatus"><label for="s1">不显示</label>&nbsp;
                    <input id="s2" type="radio" value="1"
                           name="factoryStatus"><label for="s2">显示</label>
                    <p style="color:gray"></p>
                </div>
            </div>


            <div class="form-group" style="margin-top:20px;margin-left:20px;">
                <label class="form-label col-xs-5 col-sm-2">
                    品牌故事<span style="color:lightblue">（5行内）</span>
                </label>
                <div class="formControls col-xs-8 col-sm-9">
                    <textarea placeholder="请输入品牌故事简述" name="brandStory" rows="5"
                              cols="50">${empty brand? null:brand.brandStory}</textarea>
                    <p style="color:gray"></p>
                </div>
            </div>
            <div class="form-group" style="margin-top:20px;">
                <div class="col-xs-8 col-sm-9 col-xs-offset-3 col-sm-offset-2">&nbsp;&nbsp;&nbsp;
                    <button type="submit" class="btn btn-primary radius">保存并提交</button>&nbsp;&nbsp;
                    <button onClick="javascript:history.back(-1);" class="btn btn-default radius" type="button">返回
                    </button>
                </div>
            </div>

            <div style="height:200px"></div>
        </form>
    </div>
    <script src="${pageContext.request.contextPath}/assets/js/jquery.nicescroll.js"></script>
    <script src="${pageContext.request.contextPath}/assets/js/functions.js"></script>
</body>